<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="org.hibernate.*"%>
<%@page import="org.hibernate.cfg.*"%>

<%
     request.setCharacterEncoding("UTF-8");
     String batchIds = request.getParameter("batchIds");
	 System.out.print("==============================="+batchIds);
	 String[] ids=batchIds.split(";");
	 SessionFactory sf = new Configuration().configure().buildSessionFactory();
	 Session session1 = sf.openSession();
	 for(int i=0;i<ids.length;i++){
		 String Hql="delete Sendmsg where msg_id="+Integer.parseInt(ids[i]);
		 Transaction tran = session1.beginTransaction();
		 Query query=session1.createQuery(Hql);
		 query.executeUpdate();
         //session1.beginTransaction().commit();
	 }
	 session1.close();
	    out.println("<script language='javascript'>");
	    out.println(" alert('删除信息成功！')");
	    out.println("  parent.window.location.reload();");
	    out.println("</script>");
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
hello
</body>
</html>